#include <iostream>
#include <list>
#include <deque>

using namespace std;

void test(){
    list<int> number1 = {1,2,3,4,5,6,7,8,9};
    deque<int> number2;
    deque<int> number3;

    for(auto &ele:number1){
        if(ele % 2 == 0){
            number2.push_back(ele);
        }
        else{
             number3.push_back(ele);
        }

    }
    for(auto & de2:number2){
        cout << de2 << " ";
    }
    cout <<endl;
    for(auto & de3:number3){
        cout << de3 << " ";
    }
    cout <<endl;

}

int main()
{
    test();
    return 0;
}

